package com.qf.cx.simplenms.link.utils;

/**
 * Created by linda on 2016/11/13.
 */
public  class Utils {
    public static String arr2String(int [] arr){
        StringBuilder strb=new StringBuilder();
        for(int x:arr)
        {
            String tmp = String.format("%02x", x);
            strb.append(tmp);
        }
        return strb.toString();
    }
    public static int[] byte2uchar(byte[] s)
    {
        int[] d = new int[s.length];
        int tmp = 0;
        for(int i = 0; i < s.length; i++)
        {
            tmp  = s[i];
            tmp = tmp & 0xff;
            d[i] = tmp;
        }
        return d;
    }
    
    public static void sleepms(int ms) {
        try {
            Thread.sleep(ms);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
